home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
filutil
/
pa_st270.zip
/
EXAMPLE4.POM
< prev
next >
Wrap
Text File
|
1995-02-01
|
5KB
|
109 lines
; The following comment lines are for quick-reference.
; Copy them into your own POM files to make programming easier.
;
; In the table below:
;
; "var" means a variable that is being set.
; "value" means a variable whose value is being read.
; Square brackets [like this] indicate optional items.
;
; ------------------------------------------- ------------------------------
; COMMAND FORMATS EXAMPLE
; =========================================== ==============================
; SET var1 value1 SET NAME $FLINE[20 26]
; IF value1 value2 var1 value3 [value4] IF X = "Y" THEN Z = "N"
; ------------------------------------------- ------------------------------
; BEGIN value1 value2 BEGIN LINECNTR = "3"
; END END
; ------------------------------------------- ------------------------------
; OUT [value1 value2] |output-picture OUT "X" "X" |{PRICE}
; OUTEND [value1 value2] |output-picture OUTEND "X" "X" |{$FLINE}
; OUTHDG value1 OUTHDG "LIST OF EMPLOYEES"
; PAGELEN value1 [value2] PAGELEN "66" "N"
; ------------------------------------------- ------------------------------
; MINLEN value1 MINLEN "15"
; IGNORE value1 value2 IGNORE PRICE "0.00"
; ACCEPT value1 value2 ACCEPT $FLINE[1 3] "YES"
; ------------------------------------------- ------------------------------
; TRIM var1 spec1 character TRIM PRICE "R" "$"
; PAD var1 spec1 character len PAD SERIALNUM "L" "0" "10"
; INSERT var1 spec1 value1 INSERT PRICE "L" "$"
; CHANGE var1 value1 value2 CHANGE DATE "/" "-"
; ------------------------------------------- ------------------------------
; SPLIT from to [,from to] [...] SPLIT 1 250, 251 300
; CHOP from to [,from to] [...] CHOP 1 250, 251 300
; ------------------------------------------- ------------------------------
; LOOKUP var1 value1 LOOKUP PHONENUM "FRED JONES"
; LOOKFILE value1 LOOKFILE "C:\TABLES\DATA.TBL"
; LOOKCOLS value1 value2 value3 value4 LOOKCOLS "1" "3" "8" "255"
; LOOKSPEC value1 value2 value3 LOOKSPEC "Y" "N" "N"
; ------------------------------------------- ------------------------------
; TRACE var1 TRACE PRICE
; ------------------------------------------- ------------------------------
;
; DEFAULT VALUES
; --------------
;
; MINLEN: 1
; PAGELEN: 0
; LOOKCOLS: Keyfield Start = 1, End = 10; Datafield Start = 12, End = 255
; LOOKSPEC: Trim = Yes; Sorted = No; Case-sensitive = No
; LOOKFILE: No default, but you can set the file name via the /L parameter
;
; ---------------------------------------------------------------------------
;
;
; PADDING FOR CLARITY
; -------------------
;
; Before: IF PRICE "0.00" BONUS "1.00" "0.00
; After: IF PRICE = "0.00" THEN BONUS = "1.00" ELSE "0.00
;
;
;******************************************************************************
;
; Restrict the lines we'll accept
;
ACCEPT $FLINE[58 60] = "IBM"
ACCEPT $FLINE[58 60] = "MAC"
;
; Pad out description, with spaces, to 40 characters
; We'll also modify the string -PC to read -IBMPC
; Note the trailing space after PC to ensure it's at the end of the string
;
SET descrip = $FLINE[19 49]
INSERT descrip "@PC " "IBM"
PAD descrip "R" " " "40"
;
; Make quantity only 2 characters wide (maximum would therefore be 99)
;
SET qty = $FLINE[63 66]
TRIM qty "A" " "
PAD qty "L" " " "2"
;
; Take only the last three digits of the invoice number
;
SET inv = $FLINE[14 16]
;
; Detect minus sign and set price accordingly
;
SET price = $FLINE[70 76]
TRIM price "A" " "
IF $FLINE[77] = "-" THEN minus = "-" ELSE ""
INSERT price "L" minus
PAD price "L" " " "7"
INSERT price "L" "$"
;
; Set other fields; note use of uppercase for type
;
SET itemnum = $FLINE[01 07]
SET type = $FLUPC[51 55]
SET cat = $FLINE[58 60]
;
; Set output as follows:
; Invoice, Item, Type (in uppercase), Category
; Description, Quantity, Unit price
;
OUT "" "" |{inv} {itemnum} {type} {cat}
OUTEND "" "" | {descrip} {qty} {price}